<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/includes/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<title>检索测试....</title>
<meta name="menu" content="search" />
	<link rel="stylesheet" type="text/css" href="<c:url value='/jqueryui/style.css'/>" ></link>
	<script src="<%=request.getContextPath() %>/jqueryui/css/5grid/init.js?use=mobile,desktop,1000px&amp;mobileUI=1&amp;mobileUI.theme=none"></script>
	
   <object classid = "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
	<param name="LPKPath" value="/CarPlat/cabs/DynamicWebTwain.lpk" />
   </object>
</head>
<body>

<form id="colorForm" action="<%=request.getContextPath() %>/search.do?action=search" method="post" style="margin: 0px;">
<input name="isCompare" value="N" id="_bisCompare" type="hidden">
<%
  	String compareType =  (String)request.getAttribute("compareType");
  	int intype = 1;
  if(compareType!=null)
  {
	  intype = Integer.parseInt(compareType);
  }
  %>
	 <select name="compareType" style="display: none;" >
	 	<%for(int c1=1 ;c1<=11;c1++){ %>
	 		<option value="<%=c1 %>" <%=intype==c1?"selected":"" %>><%=c1 %></option>
	 	<%} %>
	 </select>
	 
	 
	 <input type="hidden" name="fileName" value="<%=request.getAttribute("fileName") %>" id="_fileName"> 
 
 
     
<table border="0" align="center" width="85%" >
 <tr>
 <td  align="right" >
    <%@include file="/includes/scan.jsp" %>
    </td>
		<td  align="right" >
	 		<table>
	 			<tr onclick="upload();" style="cursor:pointer;" title="图片上传">
	 				<td >
	 					<img  src="<c:url value='/styles/icon/viewmag.png'/>" style="filter:Gray;" id="queryImage"/>
	 				</td>
	 				<td style="font-stretch:20;font-weight: 20">
	 				<h3>图片检索</h3>
	 				</td>
	 			</tr>
	 		</table>
	 		</td>
	</tr>
</table>
	<div id="dialog-modal" style="display: none;overflow: hidden;" title="文件上传 "> 
		<iframe src="uploadFile.do?action=goFileUpload&pageStyle=showpage&fileType=jpg&maxSize=5" frameborder=0 width="100%" height="100"  id="uploadframe" style="overflow: hidden;" name="uploadframe">
		</iframe>
	</div>
</form>
<div id="wrapper">
	<div class="5grid-layout">
		<div id="feature-content">
<%int count = 1 ;%>
			<section>
				<h2>搜索结果</h2>
			</section>
			<div class="row">
				<div class="12u">
					<c:forEach var="imagePath" items="${results}">
						<div class="3u" style="width:118px;">
							<section>
								<div>
									<div class="image-style1"><a href="#">
										<img src="<%=request.getContextPath() %>/image/id/${imagePath}" alt="" style="width:110px;height: 80px;" onclick="clickimage('${imagePath}');"    style="cursor: pointer;"/>
									 </a></div>
								</div>
								<p>(<%=count %>)红色10%</p>
							</section>
						</div>
						<%count++; %>
						</c:forEach>
				</div>
			</div>
		</div>
	</div>
</div>
		 

<script>

function uploadshow(){ 
	$( "#dialog-modal" ).dialog({
		height: 180,
		width: 400,
		modal: true,buttons: {
			"上传 ": function() {
				window.frames["uploadframe"].window.submitform();
			}
		}
	});
}


function query(){
	var frmObj=document.getElementById("colorForm");
	frmObj.submit();	
}

function clickimage(file){
	document.getElementById("_fileName").value=file;
	document.getElementById("_bisCompare").value="N";
	query();
}

function callback(realName,saveName){ 
	document.getElementById("_fileName").value=realName;
	document.getElementById("_bisCompare").value="Y";
	query();
    //回调后其它操作  
}  
function scanquery(){ 
	document.getElementById("_bisCompare").value="Y";
	query();
    //回调后其它操作  
}  
function openUpload2(){  
    openUploadJSFuc("<%=request.getContextPath()%>",'JPG,GIF,JPEG,PNG','5',callback2);  
}  
function openUpload(){  
	   var win = window.open("<%=request.getContextPath()%>/pages/scan/fileScan.jsp","","width:300px,height:470px,scroll:no,status:no,toolbar=no,menubar=no,location=no");  
}   
</script>
</body>
</html>
